//
//  UIButton+FTLanguage.m
//  FashionTech
//
//  Created by JackieYip on 16/9/20.
//  Copyright © 2016年 mondial-d. All rights reserved.
//

#import "UIButton+FTLanguage.h"

// Component_FTBundle
#import "FTMediator+FTBundle.h"
// FTMediator
#import "FTMediator.h"

@implementation UIButton (FTLanguage)
- (NSString *)pngImageLocalString
{
    return @"";
}
- (NSString *)JPEGImageLocalString
{
    return @"";
}

- (void)setPngImageLocalString:(NSString *)imageLocalString
{
    [self setImageLocalString:imageLocalString withType:@"png"];
}

- (void)setJPEGImageLocalString:(NSString *)imageLocalString
{
    [self setImageLocalString:imageLocalString withType:@"jpg"];
}

- (void)setImageLocalString:(NSString *)imageLocalString withType:(NSString *)type
{
    imageLocalString = [NSString stringWithFormat:@"%@@%ldx", imageLocalString, (long)[UIScreen mainScreen].scale];
    NSString *bundle = [[kFTMediator FTBundle_bundle] pathForResource:imageLocalString ofType:type];
    
    [self setImage:[UIImage imageWithContentsOfFile:bundle] forState:UIControlStateNormal];
}

@end
